import { watch, ref } from 'vue'
import { useRoute } from 'vue-router'


export default function useBreadcrumbs() {
  const route = useRoute()
  const breadcrumbsList = ref<any[]>([])

  // 监听路由对象，每一次路由变化生成新的面包屑列表
  watch(route, () => {
    const list = route.matched

    console.log('list: ', list)
  }, { immediate: true })

  return breadcrumbsList
}